package yao.spider.jsoup.common;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class MyDateUtils {

	public static Date parseDate(String dateStr, String pattern) {
		Date date = null; // 提供默认值
		SimpleDateFormat sdf = new SimpleDateFormat(pattern);
		try {
			date = sdf.parse(dateStr);
		} catch (ParseException e) {
			//e.printStackTrace();
			System.out.println("解析错误");
		}
		return date;
	}
}
